home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / lgrind 1.0.1 / lgrindefs.5 < prev    next >
Encoding:
Text File  |  1993-04-22  |  5.9 KB  |  229 lines  |  [TEXT/MPS ]

  1. .\" @(#)vgrindefs.5 1.16 90/02/15 SMI; from UCB 4.3
  2. .\" Copyright (c) 1983 Regents of the University of California.
  3. .\" All rights reserved.  The Berkeley software License Agreement
  4. .\" specifies the terms and conditions for redistribution.
  5. .\"
  6. .\" $Id: lgrindefs.5,v 1.2 91/10/01 00:32:05 gvr Exp $
  7. .\"
  8. .\" This is the standard SunOS vgrindefs(5) manpage, with a few
  9. .\" additions to describe the extra capabilities needed by lgrind,
  10. .\" viz.: zb, ze, tb, te, mb, me, vb, ve.
  11. .\"
  12. .tr ||
  13. .TH LGRINDEFS 5 "9 September 1991"
  14. .SH NAME
  15. lgrindefs \- lgrind's language definition data base
  16. .SH SYNOPSIS
  17. .B /cs/src/lgrind/lgrindefs
  18. .SH DESCRIPTION
  19. .IX  "lgrindefs file"  ""  "\fLlgrindefs\fP \(em lgrind language definitions"
  20. .B lgrindefs
  21. contains all language definitions for
  22. .BR lgrind (1).
  23. The data base is very similar to
  24. .BR vgrind (5)
  25. and
  26. .BR termcap (5),
  27. and it is upward-compatible with that of
  28. .BR vgrind (5).
  29. Capabilities in
  30. .B lgrindefs
  31. are of two types:
  32. Boolean capabilities which indicate that the language has
  33. some particular feature
  34. and string
  35. capabilities which give a regular expression or
  36. keyword list.
  37. Entries may continue onto multiple lines by giving a \e as the last
  38. character of a line.
  39. Lines starting with # are comments.
  40. .SS Capabilities
  41. The following table names and describes each capability.
  42. .PP
  43. .PD 0
  44. .ta \w'\fBName\fP  'u
  45. .nr Xx \w'\fBName\fP  \fBType\fP  'u
  46. .TP \n(Xxu
  47. .B
  48. Name    Type
  49. .B Description
  50. .TP
  51. .B ab    \fRstr
  52. Regular expression for the start of an alternate form comment
  53. .TP
  54. .B ae    \fRstr
  55. Regular expression for the end of an alternate form comment
  56. .TP
  57. .B bb    \fRstr
  58. Regular expression for the start of a block
  59. .TP
  60. .B be    \fRstr
  61. Regular expression for the end of a lexical block
  62. .TP
  63. .B cb    \fRstr
  64. Regular expression for the start of a comment
  65. .TP
  66. .B ce    \fRstr
  67. Regular expression for the end of a comment
  68. .TP
  69. .B id    \fRstr
  70. String giving characters other than letters and digits
  71. that may legally occur in identifiers (default `_')
  72. .TP
  73. .B kw    \fRstr
  74. A list of keywords separated by spaces
  75. .TP
  76. .B lb    \fRstr
  77. Regular expression for the start of a character constant
  78. .TP
  79. .B le    \fRstr
  80. Regular expression for the end of a character constant
  81. .TP
  82. .B mb    \fRstr
  83. Regular expression for the start of TeX math within a comment
  84. .TP
  85. .B me    \fRstr
  86. Regular expression for the end of TeX math within a comment
  87. .TP
  88. .B oc    \fRbool
  89. Present means upper and lower case are equivalent
  90. .TP
  91. .B pb    \fRstr
  92. Regular expression for start of a procedure
  93. .TP
  94. .B pl    \fRbool
  95. Procedure definitions are constrained to the lexical level
  96. matched by the `px' capability
  97. .TP
  98. .B px    \fRstr
  99. A match for this regular expression indicates
  100. that procedure definitions may occur at the next lexical level.
  101. Useful for lisp-like languages in which procedure definitions
  102. occur as subexpressions of defuns.
  103. .TP
  104. .B sb    \fRstr
  105. Regular expression for the start of a string
  106. .TP
  107. .B se    \fRstr
  108. Regular expression for the end of a string
  109. .TP
  110. .B tb    \fRstr
  111. Regular expression for the start of TeX text within a comment
  112. .TP
  113. .B tc    \fRstr
  114. Use the named entry as a continuation of this one
  115. .TP
  116. .B te    \fRstr
  117. Regular expression for the end of TeX text within a comment
  118. .TP
  119. .B tl    \fRbool
  120. Present means procedures are only defined at the top lexical level
  121. .TP
  122. .B vb    \fRstr
  123. Regular expression for the start of typewriter text within a comment
  124. .TP
  125. .B ve    \fRstr
  126. Regular expression for the end of typewriter text within a comment
  127. .TP
  128. .B zb    \fRstr
  129. Regular expression for the start of program text within a comment
  130. .TP
  131. .B ze    \fRstr
  132. Regular expression for the end of program text within a comment
  133. .PD
  134. .DT
  135. .SS "Regular Expressions"
  136. .B lgrindefs
  137. uses regular expressions similar to those of
  138. .BR ex (1)
  139. and
  140. .BR lex (1).
  141. The characters `^',
  142. `$',
  143. `\^|',
  144. `:',
  145. and `\e'
  146. are reserved characters and must be
  147. `quoted' with a preceding \e if they
  148. are to be included as normal characters.
  149. The metasymbols and their meanings are:
  150. .IP $
  151. The end of a line
  152. .PD 0.2v
  153. .IP ^
  154. The beginning of a line
  155. .IP \ed
  156. A delimiter (space, tab, newline, start of line)
  157. .IP \ea
  158. Matches any string of symbols
  159. (like `.*' in lex)
  160. .IP \ep
  161. Matches any identifier.
  162. In a procedure definition
  163. (the `pb' capability)
  164. the string that matches this symbol is used as the procedure name.
  165. .IP (\^)
  166. Grouping
  167. .IP |
  168. Alternation
  169. .IP ?
  170. Last item is optional
  171. .IP \ee
  172. Preceding any string means that the string will not match an
  173. input string if the input string is preceded by an escape character (\e).
  174. This is typically used for languages (like C) that can include the
  175. string delimiter in a string by escaping it.
  176. .PD
  177. .PP
  178. Unlike other regular expressions in the system,
  179. these match words and not characters.
  180. Hence something like `(tramp\^|\^steamer)flies?'
  181. would match `tramp',
  182. `steamer',
  183. `trampflies',
  184. or `steamerflies'.
  185. Contrary to some forms of regular expressions,
  186. .B lgrindef
  187. alternation binds very tightly.
  188. Grouping parentheses are likely to be necessary in expressions
  189. involving alternation.
  190. .SS "Keyword List"
  191. The keyword list is just a list of keywords in the language separated
  192. by spaces.
  193. If the `oc' boolean is specified,
  194. indicating that upper and lower case are equivalent,
  195. then all the keywords should be specified in lower case.
  196. .SH EXAMPLE
  197. The following entry,
  198. which describes the C language,
  199. is typical of a language entry.
  200. .IP
  201. .ft B
  202. .nf
  203. C\^|\^c\^|\^the C programming language:\e
  204.     :pb=^\ed?*?\ed?\ep\ed?\(\ea?\):bb={:be=}:cb=/*:ce=*/:\e
  205.     :sb=":se=\ee":lb=':le=\ee':tl:\e
  206.     :zb=@:ze=@:tb=%%:te=%%:mb=%\e$:me=\e$%:vb=%\e\^|:ve=\e\^|%:\e
  207.     :kw=asm auto break case char continue default do double\e
  208.     else enum extern float for fortran goto if int long\e
  209.     register return short sizeof static struct switch typedef\e
  210.     union unsigned while #define #else #endif #if #ifdef\e
  211.     #ifndef #include #undef # define else endif if ifdef\e
  212.     ifndef include undef:
  213. .fi
  214. .ft
  215. .PP
  216. Note that the first field is just the language name
  217. (and any variants of it).
  218. Thus the C language could be specified to
  219. .BR lgrind (1)
  220. as `c' or `C'.
  221. .SH FILES
  222. .ta \w'/cs/src/lgrind/lgrindefs   'u
  223. \fB/cs/src/lgrind/lgrindefs\fR    file containing terminal descriptions
  224. .SH "SEE ALSO"
  225. .BR latex (1),
  226. .BR lgrind (1),
  227. .BR vgrindefs (5)
  228.  
  229.